package com.xishu.entity.shop;

import com.xishu.annotation.dao.DefaultValue;
import com.xishu.annotation.lang.Lang;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * 套餐里面的一项
 */
public class SetMenuOneItem implements Serializable {
    private static final long serialVersionUID = -2798855251148333410L;

    @ApiModelProperty(value = "套餐里面的标签ID")
    private Long id;

    @ApiModelProperty(value = "是否是固定菜品")
    private Boolean fixed;

    @ApiModelProperty(value = "标签，不是固定菜品的时候，需要填写标签")
    @Lang(key = "name")
    private String catalog;

    @ApiModelProperty(value = "标签--中文")
    @Lang(key = "name")
    private String catalog_zh;

    @ApiModelProperty(value = "标签--英文")
    @Lang(key = "name")
    private String catalog_en;

    @ApiModelProperty(value = "份数")
    private Integer itemNumber;

    @ApiModelProperty(value = "最小份数")
    private Integer minNumber;

    @ApiModelProperty(value = "最大份数")
    private Integer maxNumber;

    @ApiModelProperty(value = "是否加配")
    private Boolean addAdditional;

    @ApiModelProperty(value = "加价项的价格")
    private Double addPrice;

    @ApiModelProperty(value = "选中了哪些菜")
    private List<Item> itemList;

    @ApiModelProperty(value = "是否要打印菜名")
    @DefaultValue(defaultValue = "false")
    private Boolean notPrintItemName;

    @ApiModelProperty(value = "显示顺序，用于foodpanda的套餐下面的菜品排序")
    private Integer order;

    public Boolean getNotPrintItemName() {
        return notPrintItemName;
    }

    public void setNotPrintItemName(Boolean notPrintItemName) {
        this.notPrintItemName = notPrintItemName;
    }

    public Integer getMinNumber() {
        return minNumber;
    }

    public void setMinNumber(Integer minNumber) {
        this.minNumber = minNumber;
    }

    public Integer getMaxNumber() {
        return maxNumber;
    }

    public void setMaxNumber(Integer maxNumber) {
        this.maxNumber = maxNumber;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Boolean getFixed() {
        return fixed;
    }

    public void setFixed(Boolean fixed) {
        this.fixed = fixed;
    }

    public String getCatalog() {
        return catalog;
    }

    public void setCatalog(String catalog) {
        this.catalog = catalog;
    }

    public String getCatalog_zh() {
        return catalog_zh;
    }

    public void setCatalog_zh(String catalog_zh) {
        this.catalog_zh = catalog_zh;
    }

    public String getCatalog_en() {
        return catalog_en;
    }

    public void setCatalog_en(String catalog_en) {
        this.catalog_en = catalog_en;
    }

    public Integer getItemNumber() {
        return itemNumber;
    }

    public void setItemNumber(Integer itemNumber) {
        this.itemNumber = itemNumber;
    }

    public Boolean getAddAdditional() {
        return addAdditional;
    }

    public void setAddAdditional(Boolean addAdditional) {
        this.addAdditional = addAdditional;
    }

    public Double getAddPrice() {
        return addPrice;
    }

    public void setAddPrice(Double addPrice) {
        this.addPrice = addPrice;
    }

    public List<Item> getItemList() {
        return itemList;
    }

    public void setItemList(List<Item> itemList) {
        this.itemList = itemList;
    }

    public Integer getOrder() {
        return order;
    }

    public void setOrder(Integer order) {
        this.order = order;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("SetMenuOneItem{");
        sb.append("itemCatalogId=").append(id);
        sb.append(", fixed=").append(fixed);
        sb.append(", catalog='").append(catalog).append('\'');
        sb.append(", catalog_zh='").append(catalog_zh).append('\'');
        sb.append(", catalog_en='").append(catalog_en).append('\'');
        sb.append(", itemNumber=").append(itemNumber);
        sb.append(", addAdditional=").append(addAdditional);
        sb.append(", addPrice=").append(addPrice);
        sb.append(", itemList=").append(itemList);
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof SetMenuOneItem)) return false;
        SetMenuOneItem that = (SetMenuOneItem) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(fixed, that.fixed) &&
                Objects.equals(itemList, that.itemList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, fixed, itemList);
    }
}
